
wellcomeMessage = {
	setFirstTime : function(){
		Ti.App.Properties.setBool(Ti.App.config.welcomeMessageVar,false);
	},

	isFirstTime : function (){
		return Ti.App.Properties.getBool(Ti.App.config.welcomeMessageVar,true);
	},

	showFirstTimeMessage : function(){
		if(this.isFirstTime()){
			this.show();
		}
	},
	
	show : function(){
		var winWellcome = Titanium.UI.createWindow({
			backgroundColor:'#111',
			opacity:0.8
		});

		var wellcomeDialog = Ti.UI.createView({
			fontColor:'#FFF',
			width:280,
			height:400,
			backgroundColor:'#CCC',
			borderColor:'#FFF',
			borderRadius:5.0,
			borderWidth:2.0,
			backgroundImage:'img/background2.png'
	    });

		var buttonOk = Ti.UI.createButton({
			font:{size:"8"},
			bottom:20,
			height:40,
			width:100,
			title:L('continuar')
		});
		buttonOk.addEventListener('click',function(){
			winWellcome.close();
			wellcomeMessage.setFirstTime();
		});
		
		var text1 = Ti.UI.createLabel({
			font:{fontSize:"16"},
			top:10,
			left:20,
			height:30,
			width:220,
			text:L('entrar')
		});
		
		var text2 = Ti.UI.createLabel({
			font:{fontSize:"13"},
			top:30,
			bottom:80,
			height:'auto',
			left:20,
			width:240,
			text:L('quisom')+"\n\n" + L('benvinguda1')+"\n\n"+L('benvinguda2')+"\n\n"+L('benvinguda3')
		});
		wellcomeDialog.add(text1);
		wellcomeDialog.add(text2);
		wellcomeDialog.add(buttonOk);
		wellcomeDialog.show();
		winWellcome.add(wellcomeDialog);
		winWellcome.open();
	}
	
};